package net.ibizsys.eclipse.studio.xml;

import java.util.HashMap;
import java.util.Map;

/**
 * 文件类型
 * 
 * @author <a href='http://www.weibo.com/xjtoo' target='_blank'>Enmaai</a>
 */
public enum IBizFileType
{
	Unknown(0, "", "未知", ""), PF(100, "PF", "前台", ""),

	/**
	 * 
	 */
	PF_CONTROLLER(101, "PF_CONTROLLER", "前台视图控制器(JS)", "icons/js.png"),
	/**
	 * 
	 */
	PF_JSP(102, "PF_JSP", "前台视图容器页面(JSP)", "icons/jsp.gif"),
	/**
	 * 
	 */
	PF_JSPPART(103, "PF_JSPPART", "前台视图内容页面(JSP)", "icons/jsp.gif"),

	PF_JSPCTRL(104, "PF_JSPCTRL", "前台视图页面部件(JSP)", "icons/jsp.gif"),

	/**
	 * 
	 */
	SF(200, "SF", "服务", "icons/java.png"),
	/**
	 * 
	 */
	SF_CONTROLLER(201, "SF_CONTROLLER", "后台视图控制器(JAVA)", "icons/java.png"),
	/**
	 * 
	 */
	SF_CTRLHANDLER(202, "SF_CTRLHANDLER", "后台控件处理(JAVA)", "icons/java.png"),
	/**
	 * 
	 */
	SF_CTRLMODEL(203, "SF_CTRLMODEL", "后台控件模型(JAVA)", "icons/java.png"),
	/**
	 * 
	 */
	SF_SERVICE(204, "SF_SERVICE", "Service对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_DAO(205, "SF_DAO", "DAO对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_ENTITY(206, "SF_ENTITY", "Entity对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_DEMODEL(207, "SF_DEMODEL", "实体模型对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_CODELISTMODEL(208, "SF_CODELISTMODEL", "代码表模型对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_DEACMODEL(209, "SF_DEACMODEL", "实体自动填充模型对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_DEDSMODEL(210, "SF_DEDSMODEL", "实体数据集合模型对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_DEDQMODEL(211, "SF_DEDQMODEL", "实体数据查询模型对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_DELOGICMODEL(212, "SF_DELOGICMODEL", "实体逻辑模型对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_WFMODEL(213, "SF_WFMODEL", "流程模型对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_WFVERMODEL(214, "SF_WFVERMODEL", "流程版本模型对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_DEUIACTIONMODEL(215, "SF_DEUIACTIONMODEL", "实体界面行为模型对象", "icons/java.png"),
	/**
	 * 
	 */
	SF_CTRLITEMHANDLER(216, "SF_CTRLITEMHANDLER", "后台控件子项处理(JAVA)", "icons/java.png");

	private int value;
	private String code;
	private String text;
	private String icon;

	private IBizFileType(int value, String code, String text, String icon)
	{
		this.value = value;
		this.code = code;
		this.text = text;
		this.icon = icon;
	}

	private static final Map<String, IBizFileType> map = new HashMap<String, IBizFileType>();
	static
	{
		for (IBizFileType val : values())
		{
			map.put(val.code(), val);
		}
	}

	public static IBizFileType convert(String name)
	{
		if (map.containsKey(name))
		{
			return map.get(name);
		}
		return IBizFileType.Unknown;
	}

	public int value()
	{
		return this.value;
	}

	public String code()
	{
		return code;
	}

	public String text()
	{
		return text;
	}

	public String icon()
	{
		return icon;
	}
}
